package com.wf.it.hpwebplan.config;

import com.wf.it.hpwebplan.interceptor.JwtInterceptor;
import com.wf.it.hpwebplan.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        JwtInterceptor jwtInterceptor=new JwtInterceptor();
        registry.addInterceptor(jwtInterceptor).addPathPatterns("/**").order(30).excludePathPatterns("/favicon.ico");
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**").order(35).excludePathPatterns("/favicon.ico");
    }
}
